package cn.pn.project.client.commodity;

import cn.pn.project.client.commodity.follback.CommodityFeignFallBack;
import cn.pn.project.module.commodity.CommodityModule;
import cn.pn.project.pojo.commodity.Commodity;
import cn.pn.project.vo.CommodityVo;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

@FeignClient(name="pn-item-provider",fallback = CommodityFeignFallBack.class)
public interface CommodityFeign {
    /**
     * 根据商品id 查询商品信息
     * @param commodityId
     * @return
     */
    @PostMapping("/findCommodityAllMessage")
    CommodityModule findCommodityAllMessage(@RequestParam("commodityId") Integer commodityId);

    @RequestMapping(value = "/getDisCommodityListByCityId",method = RequestMethod.POST)
    List<Commodity> getDisCommodityListByCityId(@RequestBody Map<String,Object> one);

    @RequestMapping(value = "/getHotCommodityListByCityId", method = RequestMethod.POST)
    List<Commodity> getHotCommodityListByCityId(@RequestBody Map<String,Object> one);

    @RequestMapping(value = "/getCommodityScheduleByCommodityId", method = RequestMethod.POST)
    List<Commodity> getCommodityScheduleByCommodityId(@RequestParam("commodityId")Integer commodityId);

    @RequestMapping(value = "/getCommodityListByCityIdAndFatherTypeId", method = RequestMethod.POST)
    List<Commodity> getCommodityListByCityIdAndFatherTypeId(@RequestBody Map<String,Object> one);

    @RequestMapping(value = "/getCommodityCountByCityIdAndFatherTypeId", method = RequestMethod.POST)
    List<Commodity> getCommodityCountByCityIdAndFatherTypeId(@RequestParam("fatherTypeId") Integer fatherTypeId,@RequestParam("cityId")Integer cityId);

    @RequestMapping(value = "/getCommodityByMoreReason", method = RequestMethod.POST)
    List<Commodity> getCommodityByMoreReason(@RequestBody Map<String,Object> one);

    @RequestMapping(value = "/getCountCommodityByMoreReason", method = RequestMethod.POST)
    List<Commodity> getCountCommodityByMoreReason(@RequestBody Map<String,Object> one);

    @RequestMapping(value = "/getCommodityByCommodityIdAndCommodityStatus", method = RequestMethod.POST)
    List<CommodityVo> getCommodityByCommodityIdAndCommodityStatus(@RequestBody Map<String,Object> one);


    @RequestMapping(value = "/getCommodityByCommodityId", method = RequestMethod.GET)
    Commodity getCommodityByCommodityId(@RequestParam("commodityId")Integer commodityId);
}
